<template>
  <div>
    <xy-table
      ref="xy-table"
      :columns="columns"
      :api="api"
      :param="param"
      :addFormDTO="addForm"
    >
      <template slot="addItem">
        <search-header :model="param" :on-search="onSearch"> </search-header>
      </template>
    </xy-table>
  </div>
</template>

<script>
import API from "../../plugins/api";

export default {
  name: "payroll",

  data() {
    return {
      api: new API("/api/Payrefund/"),
      columns: {
        ordrId: "代发订单号",
        BeneficiaryName: "收款人姓名",
        // CanceltrxId: "退款单号",
        refundAmount: "退款金额",
        refundReason: "退款说明",
        Status: "",
      },
      user: this.$store.getters.user,
      addForm: {
        MID: "",
        BeneficiaryName: "",
        ordrId: "",
        // CanceltrxId: "",
        refundAmount: "",
        refundReason: "",
        AttFileUrl: "",
      },
      addFormKeys: {
        MID: 0,
        BeneficiaryName: "收款人姓名",
        ordrId: "代发订单号",
        // CanceltrxId: "退款单号",
        refundAmount: "退款金额",
        refundReason: "退款说明",
        AttFileUrl: "申请函附件",

        // Status: 0,
        // adduser: 0,
        //   checkuser: 0,
        //    OpenRA: 0,
      },
      services: [],
      param: {
        BeginDate: new Date(
          new Date() - 3600 * 1000 * 24 * 30
        ).toLocaleDateString(),
        EndDate: new Date().toLocaleDateString(),
        Status: "",
        // RechargeStatus: "",
      },
    };
  },
  created() {},
  methods: {
    onSearch(e) {
      // this.param.BeginDate = this.param.date[0].toLocaleDateString();
      // this.param.EndDate = this.param.date[1].toLocaleDateString();
      console.log(e);
      this.$refs["xy-table"].getData(e);
    },

    toPayRefundDetail() {},
  },
};
</script>

<style lang="less" scoped></style>
